package com.changgou.goods.dao;
import com.changgou.goods.pojo.Sku;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;


public interface SkuMapper extends Mapper<Sku> {
    //更新库存

    @Update("update tb_sku set  num = num - #{num} where id = #{skuId} and num > #{num}   ")
    int updateStocks(@Param("skuId") Long skuId,@Param("num") Integer num);
}
